#include "gtest/gtest.h"

#define private public
#define protected public

#include "tcpImpl.h"

class httpRequestTest:public testing::Test{

	


} ;

TEST_F(httpRequestTest, DefaultConstructor) {
	httpRequest hr("GET /index.php HTTP/1.1\r\nHost: localhost:8080\r\nContent-Length:394\r\nAccept-Language: zh-CN,zh;q=0.8\r\n");
  	EXPECT_EQ(0u, 0u);
	EXPECT_STREQ(hr.host.c_str(),"localhost:8080");
	EXPECT_STREQ(hr.resource.c_str(),"/index.php");
	EXPECT_EQ(hr.Content_Length,394);
}
  
TEST_F(httpRequestTest, DefaultConstructor1) {
	 httpResponse  res;
        res.setTxt("2.txt");
        std::string outstr=res.generator();
	std::cout<<outstr<<endl;
  	EXPECT_EQ(0u, 0u);
}

TEST_F(httpRequestTest, TestRange) {
	 httpRequest hr("GET /get_one_header_no_body HTTP/1.1\r\nRange: bytes=0-801\r\n");
  	 EXPECT_EQ(hr.offset, 0);
  	 EXPECT_EQ(hr.end, 801);
}
